package com.menu.result;

/**
 * author: MaHX
 * date: 2019/8/9/17:01
 * description:
 **/
public class ResultFactory {
    public static Result buildSuccessResult(Object data){
        return buildResult(ResultCode.SUCCESS,data,"成功");
    }
    public static Result buildFailResult(String message){
        return buildResult(ResultCode.FAIL,null,message);
    }
    public static Result buildResult(ResultCode resultCode,Object data,String message){
        return buildResult(resultCode.code, data, message);
    }
    public static Result buildResult(int resultCode,Object data,String message){
        return new Result(resultCode, data, message);
    }
}
